Skip to content

Add Trio backend - #143

Merged
cgl merged 1 commit into
mainfrom
feature/trio-backend
Nov 19, 2026
Merged

cgl merged 1 commit into
mainfrom
feature/trio-backend

Conversation

@cgl

@cgl cgl commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Comment thread src/hip/backends/trio.py Resolved
Comment thread src/hip/backends/trio.py Resolved
Comment thread src/hip/backends/trio.py Outdated
Comment on lines +26 to +27
if size == 0:
return b""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trio has "must be greater than 0" for their receive_some(max_size=...).

Should we error in the zero case? (Given that b"" is supposed to indicate EOF)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, okay for this to be a follow-up.

We can tighten up the bolts as we get the API contract into place.

Comment thread src/hip/backends/trio.py Resolved
Comment thread src/hip/backends/trio.py Resolved
Comment thread src/hip/backends/trio.py Resolved
Comment thread src/hip/backends/base.py
async def connect_tls(
self, host: str, port: int, hostname: str = ""
) -> AsyncNetworkStream:
raise NotImplementedError() # pragma: nocover

@lovelydinosaur lovelydinosaur Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll also want a well defined NetworkError exception that can be raised by code in this module.

We oughta spec the API so that the only expected failure modes are a NetworkError. (Or a Timeout if wrapped in a timeout context manager.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that as a follow up maybe?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

@lovelydinosaur lovelydinosaur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think this is ready to go in.

@cgl
cgl force-pushed the feature/trio-backend branch from eb64b36 to 5a96fa4 Compare November 19, 2026 17:25
@cgl
cgl marked this pull request as ready for review November 19, 2026 17:27
@cgl
cgl merged commit 9547cc6 into main Nov 19, 2026
4 checks passed
@cgl
cgl deleted the feature/trio-backend branch November 19, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants